// Decompiled by DJ v3.9.9.91 Copyright 2005 Atanas Neshkov  Date: 07/02/2013 05:17:12 p.m.
// Home Page : http://members.fortunecity.com/neshkov/dj.html  - Check often for new version!
// Decompiler options: packimports(3) 
// Source File Name:   ConectAc.java

import java.io.*;
import java.util.*;
import javax.servlet.ServletException;
import javax.servlet.SingleThreadModel;
import javax.servlet.http.*;
import kaizen.jdbc.*;
import kaizen.nomweb.*;

public final class ConectAc extends HttpServlet
    implements SingleThreadModel
{ 

    public ConectAc()
    {
        props = null;
        dir_pagInicio = "";
    }

    public void doGet(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
        throws IOException, ServletException
    {
        PrintWriter printwriter = httpservletresponse.getWriter();
        httpservletresponse.setContentType("text/html");
        HttpSession httpsession = httpservletrequest.getSession(false);
        String s = "";
        String s1 = "";
        String s2 = "";
        String s3 = "";
        String s4 = "";
        String s5 = "";
        String s6 = "";
        String s7 = "";
        String s8 = "";
        String s9 = "";
        if(!utilerias.esEntero(httpservletrequest.getParameter("dic_estado")))
        {
            printwriter.println("Se ha tratado de entrar incorrectamente al sisema");
            return;
        }
        int i = Integer.valueOf(httpservletrequest.getParameter("dic_estado")).intValue();
        if(httpservletrequest.getParameter("dic_sistema") != null)
        {
            String s10 = "" + httpservletrequest.getParameter("dic_sistema").toString() + "Web.properties";
            try
            {
                if(props == null)
                    props = utilerias.loadProperties("/kaizen/" + s10);
                dir_pagInicio = utilerias.tomaProp("dir_pagInicio", props);
                s9 = utilerias.tomaProp("pag_salir", props);
            }
            catch(Exception _ex)
            {
                s9 = "";
                System.out.println("hubo un error al cargar " + s10);
            }
        }
        if(i == 54)
        {
            DbAppCache.borrarCache();
            s8 = "cache borrado con exito";
        }
        if(i == 10)
            if(httpsession != null)
            {
                httpsession = httpservletrequest.getSession(true);
                i = 0;
                s2 = httpsession.getAttribute("usuario").toString();
                s3 = httpsession.getAttribute("password").toString();
                s4 = httpsession.getAttribute("dt_idioma").toString();
                s7 = httpsession.getAttribute("dic_grupo").toString();
                if(s2.indexOf(' ') != -1)
                    s2 = "";
                if(s3.indexOf(' ') != -1)
                    s3 = "";
            } else
            {
                String s11 = utilerias.tomaProp("paginainicial", props);
                s8 = templates.generaPlantilla(dir_pagInicio + s11, httpservletrequest);
                printwriter.println(s8);
                return;
            }
        boolean flag = false;
        if(i == 0)
        {
            httpsession = httpservletrequest.getSession(true);
            if(httpservletrequest.getParameter("usuario") == null)
            {
                s8 = utilerias.generaError("Error 500: La pagina no existe", httpservletrequest);
                printwriter.println(s8);
                return;
            }
            if(s2 == "")
                s2 = httpservletrequest.getParameter("usuario").toString();
            if(s3 == "")
                s3 = httpservletrequest.getParameter("password").toString();
            if(s2.indexOf(' ') != -1)
                s2 = "";
            if(s3.indexOf(' ') != -1)
                s3 = "";
            if(s4 == "")
                s4 = httpservletrequest.getParameter("dic_idioma").toString();
            if(s6 == "")
                s6 = httpservletrequest.getParameter("dic_sistema").toString();
            String s12 = utilerias.tomaProp("pwdEncriptado", props);
            if(s12.equals("true"))
                s3 = Encriptacion.getEncriptar(s3);
            boolean flag1 = utilerias.validaUsuario(s2, s3, httpservletrequest);
            if(flag1)
            {
                s5 = utilerias.tomaCompania(s2, httpservletrequest);
                if(s5 == null)
                    s5 = "";
                s7 = utilerias.tomaGrupo(s2, httpservletrequest);
                if(s7 == null)
                    s7 = "";
                String s14 = httpservletrequest.getRemoteAddr();
                String s17 = httpservletrequest.getRemoteHost();
                httpsession.setAttribute("usuario", s2);
                httpsession.setAttribute("password", s3);
                httpsession.setAttribute("dic_sistema", s6);
                httpsession.setAttribute("dic_idioma", s4);
                httpsession.setAttribute("compania", s5);
                httpsession.setAttribute("dic_grupo", s7);
                httpsession.setAttribute("dic_dir_ip", s14);
                httpsession.setAttribute("dic_acceso_ip", s17);
                System.out.println("_____________________________________________________");
                String s20 = "El usuario acaba de accesar al sistema: " + s6 + ", usuario: " + s2 + " compania: " + s5;
                s20 = s20 + " grupo: " + s7 + " ip: " + s14 + " host: " + s17;
                System.out.println(s20);
                System.out.println("_____________________________________________________");
                s8 = generaInterfaceLite(i, s6, s2, s7, s4, httpservletrequest, true);
                printwriter.println(s8);
                utilerias.insertaBitacora(httpservletrequest, "");
                return;
            }
            s8 = utilerias.generaMsg("El usuario o password incorrecto, ingrese de nuevo al sistema", httpservletrequest);
            if(httpsession != null)
                httpsession.invalidate();
            else
                s8 = "El usuario o password incorrecto, ingrese de nuevo al sistema";
            printwriter.println(s8);
            return;
        }
        if(httpsession != null)
        {
            HttpSession httpsession1 = httpservletrequest.getSession(true);
            try
            {
                if(s2 == "")
                    s2 = httpsession1.getAttribute("usuario").toString();
                if(s3 == "")
                    s3 = httpsession1.getAttribute("password").toString();
                if(s4 == "")
                    s4 = httpsession1.getAttribute("dic_idioma").toString();
                if(s5 == "")
                    s5 = httpsession1.getAttribute("compania").toString();
                if(s7 == "")
                    s7 = httpsession1.getAttribute("dic_grupo").toString();
                if(s6 == "")
                    s6 = httpsession1.getAttribute("dic_sistema").toString();
            }
            catch(Exception _ex)
            {
                s8 = "El usuario o password incorrecto, ingrese de nuevo al sistema";
                printwriter.println(s8);
                return;
            }
            String s13 = "/kaizen/" + s6 + "Web.properties";
            props = utilerias.loadProperties(s13);
            boolean flag2 = utilerias.validaUsuario(s2, s3, httpservletrequest);
            if(!flag2)
            {
                s8 = utilerias.generaMsg("El usuario o password incorrecto, ingrese de nuevo al sistema", httpservletrequest);
                httpsession1.invalidate();
                printwriter.println(s8);
                return;
            }
            if(i == 9)
                s8 = generaSalidaSistema(httpsession1, httpservletrequest);
            else
            if(i == 92)
                s8 = generaInterfaceLite(i, s6, s2, s7, s4, httpservletrequest, false);
            else
            if(i == 93)
                s8 = generaArbolSistema(s7, s4, httpservletrequest);
            else
            if(i != 95)
                if(i == 96)
                {
                    String s15 = utilerias.tomaProp("pag_principal", props);
                    s8 = templates.generaPlantilla(dir_pagInicio + s15, httpservletrequest);
                } else
                if(i == 97)
                    s8 = generaJavaScriptMenus(s7, s4, httpsession1, httpservletrequest);
                else
                if(i == 1027)
                {
                    String s16 = httpservletrequest.getParameter("liga");
                    String s18 = "";
                    String s21 = "";
                    String s24 = "";
                    String s28 = "";
                    String s30 = "/scm/ayuda/" + s16.substring(s16.lastIndexOf("/") + 1, s16.length()) + ".htm";
                    if(s16 == null)
                        s16 = "No se definio la liga...";
                    if(s16.equals("/scm/servlet/pedidolinea"))
                    {
                        s18 = pedidolinea.generaPantalla(httpservletrequest, httpservletresponse, s2);
                        if(s18.indexOf("Folio Internet: ") > 0)
                        {
                            String s22 = s18.substring(s18.indexOf("Folio Internet: ") + 16, s18.length());
                            s22 = s22.substring(0, s22.indexOf("</b>"));
                            String s25 = s22.substring(0, s22.indexOf("-"));
                            s22 = s22.substring(s22.indexOf("-") + 1, s22.length());
                            s28 = "onLoad=\"javascript:window.open('/scm/servlet/confirma?serie=" + s25 + "&numero=" + s22 + "','window','resizable,scrollbars=1,width=760,height=400,left = 80,top = 100');\"";
                        }
                    } else
                    if(s16.equals("/scm/servlet/pagolinea"))
                    {
                        s18 = pagolinea.generaPagoLinea(httpservletrequest, httpservletresponse, s2);
                        Enumeration ep = httpservletrequest.getParameterNames();
                        String param = "";
                        int cont = 0;
                        while(ep.hasMoreElements()) 
                        {
                            cont++;
                            param = (String)ep.nextElement();
                        }
                    } else
                    if(s16.equals("/scm/servlet/cancelacion"))
                        s18 = cancelacion.cancela(httpservletrequest, httpservletresponse, s2);
                    else
                        s18 = templates.generaPlantilla(s16, httpservletrequest);
                    if(s18.toLowerCase().indexOf("<body") > 0)
                    {
                        s18 = utilerias.generaValDer("<body", s18);
                        s18 = utilerias.generaValDer(">", s18);
                        s18 = utilerias.generaValIzq("</body>", s18);
                    }
                    s8 = generaInterfaceLite(92, s6, s2, s7, s4, httpservletrequest, false);
                    s8 = utilerias.replaceString(s8, "<!--lnk_ayuda-->", s30);
                    s8 = utilerias.replaceString(s8, "<!--pagina-->", s18);
                    s8 = utilerias.replaceString(s8, "onLoad=\"\"", s28);
                }
            if(i == 7 || i == 8 || i == 81 || i == 82 || i == 1 || i == 11 || i == 2 || i == 21 || i == 3 || i == 31 || i == 4 || i == 5 || i == 6 || i == 66 || i == 100 || i == 111 || i == 27 || i == 128 || i == 112 || i == 113 || i == 1131 || i == 114 || i == 1141 || i == 115 || i == 116 || i == 117 || i == 118 || i == 119 || i == 77)
            {
                boolean flag3 = false;
                String s19 = "";
                if(httpservletrequest.getParameter("dic_tabla") != null)
                    s19 = httpservletrequest.getParameter("dic_tabla").toString();
                String s23 = "";
                if(httpservletrequest.getParameter("dic_permisos") != null && (i == 100 || i == 111))
                    s23 = httpservletrequest.getParameter("dic_permisos").toString();
                else
                    s23 = utilerias.validaPermisosNuevo(httpservletrequest);
                if(s23.length() > 0)
                {
                    s8 = generaInterfaceLite(92, s6, s2, s7, s4, httpservletrequest, false);
                    String s26 = "";
                    try
                    {
                        s26 = "&dic_menu=" + httpservletrequest.getParameter("dic_menu").toString() + "&dic_submenu=" + httpservletrequest.getParameter("dic_submenu").toString();
                    }
                    catch(Exception _ex)
                    {
                        _ex.printStackTrace();
                    }
                    s8 = generaAcciones(s8, s19, s6, s23, httpservletrequest, s26);
                    i = 82;
                    if(FuncEng.isSqrTable(s19, httpservletrequest))
                        i = 6;
                    if(FuncEng.isProceso(s19, httpservletrequest))
                        i = 100;
                    if(FuncEng.isForma(s19, httpservletrequest))
                        i = 112;
                } else
                {
                    s8 = utilerias.generaError("Usted no tiene permisos para esta opcion.", httpservletrequest);
                }
                if(i != 8)
                {
                    String s27 = "";
                    switch(i)
                    {
                    case 1: // '\001'
                    case 11: // '\013'
                        s27 = "A";
                        break;

                    case 2: // '\002'
                    case 21: // '\025'
                        s27 = "B";
                        break;

                    case 3: // '\003'
                    case 31: // '\037'
                        s27 = "M";
                        break;

                    case 4: // '\004'
                        s27 = "C";
                        break;

                    case 5: // '\005'
                        s27 = "R";
                        break;
                    }
                    String s29 = "";
                    boolean flag4 = false;
                    String s31 = utilerias.tomaProp("url_clases", props);
                    if(s23.indexOf(s27) >= 0)
                    {
                        int j = utilerias.setRequest(httpservletrequest);
                        try
                        {
                            s29 = templates.generaPlantilla(s31 + "/scm/servlet/EngineAc?dic_tabla=" + s19 + "&pos=" + j + "&permisos=" + s23 + "&edo=" + i, httpservletrequest);
                        }
                        catch(Exception _ex)
                        {
                            s29 = utilerias.generaError("!!ERROR 0028, Consulte al Administrador ", httpservletrequest);
                        }
                        if(s29.startsWith("redirect27"))
                        {
                            s29 = utilerias.generaValDer("redirect27", s29);
                            httpservletresponse.sendRedirect(s29);
                            return;
                        }
                    } else
                    {
                        s29 = utilerias.generaError("Usted no tiene permisos para esta opcion.", httpservletrequest);
                    }
                    if(s29.toLowerCase().indexOf("<body") > 0)
                    {
                        s29 = utilerias.generaValDer("<body", s29);
                        s29 = utilerias.generaValDer(">", s29);
                        s29 = utilerias.generaValIzq("</body>", s29);
                    }
                    if(!flag4)
                    {
                        s8 = utilerias.replaceString(s8, "<!--pagina-->", s29);
                    } else
                    {
                        String s32 = "<br><br><br>&nbsp;&nbsp;&nbsp;El resultado lo podra consultar en una ventana aparte.";
                        String s34 = "onLoad=\"MM_openBrWindow('" + s29.trim() + "','','')\"";
                        s8 = utilerias.replaceString(s8, "<!--pagina-->", s32);
                        s8 = utilerias.replaceString(s8, "onLoad=\"\"", s34);
                    }
                    if(i == 6)
                    {
                        String s33 = utilerias.tomaProp("dir_pagInicio", props);
                        String s35 = s33 + "/ayuda/" + s19 + ".htm";
                        String s36 = s33 + "/media/ayuda.jpg";
                        s36 = templates.generaImagen("ayuda", s36, "Ayuda");
                        s8 = utilerias.replaceString(s8, "<!--lnk_ayuda-->", s35);
                        s8 = utilerias.replaceString(s8, "<!--img_ayuda-->", s36);
                    }
                }
            }
        } else
        {
            switch(i)
            {
            case 9: // '\t'
                s8 = templates.generaPlantilla(dir_pagInicio + s9, httpservletrequest);
                break;

            case 10: // '\n'
                s8 = utilerias.generaError("La sesion expiro, porfavor, ingrese de nuevo al sistema.", httpservletrequest);
                break;

            default:
                s8 = "";
                break;
            }
        }
        printwriter.println(s8);
    }

    public void doPost(HttpServletRequest httpservletrequest, HttpServletResponse httpservletresponse)
        throws IOException, ServletException
    {
        doGet(httpservletrequest, httpservletresponse);
    }

    public String generaAcciones(String s, String s1, String s2, String s3, HttpServletRequest httpservletrequest, String s4)
        throws IOException
    {
        String s5 = "";
        String s6 = utilerias.tomaProp("url_clases", props);
        String s7 = "8";
        if(!FuncEng.isSqrTable(s1, httpservletrequest) && !FuncEng.isProceso(s1, httpservletrequest))
        {
            String s8 = props.getProperty("imgNuevo");
            String s10 = props.getProperty("imgBuscar");
            String s12 = "1";
            String s14 = "4";
            String s17 = utilerias.tomaProp("dir_ConectAc", props);
            String s18 = s17;
            if(FuncEng.isForma(s1, httpservletrequest))
            {
                s7 = "112";
                s12 = "113";
                String s15 = "115";
                String s19 = FuncEng.claseAparte(s1, httpservletrequest);
                if(s19.length() > 0)
                    s18 = s19;
            }
            if(s3.indexOf("A") >= 0)
                s5 = s5 + templates.generaHrefNuevo(s1, s12, "Nuevo", s8, "_self", s4, s18);
            String s20 = "7";
            if(FuncEng.isForma(s1, httpservletrequest))
                s20 = "116";
            if(FuncEng.paramBusqueda(s1, httpservletrequest))
                s5 = s5 + templates.generaHrefNuevo(s1, s20, "Busqueda", s10, "_self", s4, s18);
        } else
        if(FuncEng.isSqrTable(s1, httpservletrequest))
            s7 = "6";
        else
        if(FuncEng.isProceso(s1, httpservletrequest))
            s7 = "100";
        s = utilerias.replaceString(s, "<!--acciones-->", s5);
        String s9 = utilerias.tomaProp("dir_ConectAc", props);
        String s11 = s9 + "?dic_estado=" + s7 + "&dic_tabla=" + s1 + "&orden=1&rp_count=0&dic_sistema=" + s2 + s4;
        String s13 = utilerias.obtieneDescDic(s1, httpservletrequest);
        String s16 = templates.ligaTarget(s13, s11, "_self");
        s = utilerias.replaceString(s, "<!--programa-->", s16);
        return s;
    }

    public String generaArbolOpcion(String s, String s1, String s2, String s3, HttpServletRequest httpservletrequest, String s4)
        throws IOException
    {
        String s5 = utilerias.tomaParametro("dic_sistema", httpservletrequest);
        dir_pagInicio = utilerias.tomaProp("dir_pagInicio", props);
        if(s1 == null)
            s1 = "";
        s1 = s1.trim();
        if(s != null)
            s = s.trim();
        else
            return "Nombre de opcion incorrecta";
        if(s.length() == 0)
        {
            return "Nombre de opcion incorrecta";
        } else
        {
            String s6 = "select me_cveopc_ejec , mo_nombre,  op_url, op_prog_apart, op_tipo, me_cveopc from gentop , gentmo, gentme, gentpe ";
            s6 = s6 + " where mo_cveopc = me_cveopc_ejec  and mo_cvesis = '" + s5 + "'  and me_cvesis = mo_cvesis and  op_cvesis = mo_cvesis and pe_cvesis = mo_cvesis ";
            s6 = s6 + " and  me_cveopc_ejec = op_cveopc and pe_cveopc = me_cveopc_ejec  and pe_gpousu = '" + s2 + "' and mo_cveidi ='Esp' order by me_numopc";
            Vector vector = DbAppCache.execQuery(s6);
            s6 = " select mo_nombre from gentop , gentmo ";
            s6 = s6 + " where mo_cveopc = op_cveopc and mo_cvesis = '" + s5 + "' and mo_cveidi = '" + s3 + "'";
            s6 = s6 + " and mo_cveopc = '" + s + "'";
            String s7 = utilerias.valorSqlCache(s6);
            String s8 = "black";
            String s9 = "Arial";
            String s10 = "2";
            String s11 = "#FFFFFF";
            String s12 = templates.tablaCol(templates.generaImagen("Folder", dir_pagInicio + "/media/folder.gif", ""), s8, s9, s10, s11);
            String s13 = "<tr>" + templates.tablaCol("<b>" + s7 + "</b><br>", s8, s9, s10, s11) + "</tr>";
            s13 = utilerias.replaceString1(s13, "<td", "<td colspan=\"2\"");
            s13 = s13 + "<tr><td>&nbsp;</td><td>&nbsp;</td></tr>";
            s13 = s13 + generaOpcionesArbol(s12, s1, s, vector, s5, s4, httpservletrequest);
            return s13;
        }
    }

    private String generaArbolSistema(String s, String s1, HttpServletRequest httpservletrequest)
        throws IOException
    {
        String s2 = "";
        String s3 = httpservletrequest.getParameter("dic_menu").toString();
        String s4 = httpservletrequest.getParameter("dic_submenu").toString();
        String s5 = utilerias.tomaProp("pag_arbol", props);
        String s6 = utilerias.tomaProp("url_clases", props);
        String s7 = templates.generaPlantilla(dir_pagInicio + s5, httpservletrequest);
        String s8 = templates.generaArbolOpcion(s3, s4, s, s1, httpservletrequest, s6 + "/scm/servlet/ConectAc");
        s2 = utilerias.replaceString(s7, "<!--datos-->", s8);
        return s2;
    }

    private String generaEncabProg(String s, String s1, String s2, HttpServletRequest httpservletrequest)
        throws IOException
    {
        String s3 = "select gu_nombre from gentgu where gu_grupo = '" + s2 + "'";
        String s4 = utilerias.valorSqlUni(s3);
        s = utilerias.replaceString(s, "<!--grupo-->", s4);
        s = utilerias.replaceString(s, "<!--usuario-->", s1);
        return s;
    }

    private String generaFramesProg(HttpServletRequest httpservletrequest)
        throws IOException
    {
        String s = "";
        String s1 = httpservletrequest.getParameter("dic_menu");
        String s2 = httpservletrequest.getParameter("dic_submenu");
        String s3 = utilerias.tomaProp("pag_derOpciones", props);
        String s4 = dir_pagInicio + s3;
        String s5 = utilerias.tomaProp("url_clases", props);
        if(s2 != null)
        {
            s1 = utilerias.encuentraMenuXSubmenu(s2, httpservletrequest);
            String s6 = utilerias.encuentraLiga(s2, httpservletrequest);
            if(s6 == null)
                s6 = "";
            if(s6.startsWith("programa_aparte="))
            {
                s4 = utilerias.replaceString(s6, "programa_aparte=", "");
                s4 = s5 + "/scm/servlet/ConectAc?dic_estado=1027&dic_submenu=" + s2 + "&liga=" + s4;
            } else
            if(s6.trim().length() > 0)
                s4 = s5 + "/scm/servlet/ConectAc?dic_estado=8&dic_tabla=" + s6 + "&dic_submenu=" + s2;
        }
        String s7 = s5 + "/scm/servlet/ConectAc?dic_estado=93&dic_menu=" + s1 + "&dic_submenu=" + s2;
        String s8 = utilerias.tomaProp("pag_frmOpc", props);
        String s9 = templates.generaPlantilla(dir_pagInicio + s8, httpservletrequest);
        s = utilerias.replaceString(s9, "<!--link1-->", s7);
        s = utilerias.replaceString(s, "<!--link2-->", s4);
        return s;
    }

    public String generaInterfaceLite(int i, String s, String s1, String s2, String s3, HttpServletRequest httpservletrequest, boolean flag)
        throws IOException
    {
        String s4 = "/kaizen/" + s + "Web.properties";
        props = utilerias.loadProperties(s4);
        String s5 = utilerias.tomaProp("pag_index2", props);
        if(flag)
            s5 = "/index0.htm";
        String s6 = templates.generaPlantilla(dir_pagInicio + s5, httpservletrequest);
        s6 = generaEncabProg(s6, s1, s2, httpservletrequest);
        String s7 = "select mo_cveopc, mo_nombre from gentmo, gentme, gentsi where me_cvesis = '" + s + "' and mo_cvesis = me_cvesis " + "and mo_cvesis = si_cvesis and me_cveopc_ejec = mo_cveopc " + "and me_cveopc = si_cve_menu order by me_numopc";
        Vector vector = DbAppUnivC.execQuery(s7);
        vector = utilerias.generaVectorStr_ksRecord(vector);
        String s8 = "";
        String s9 = utilerias.tomaProp("dir_ConectAc", props);
        for(int j = 0; j < vector.size(); j++)
        {
            String as[] = (String[])vector.elementAt(j);
            String s11 = s9 + "?dic_estado=92&dic_menu=" + as[1];
            if(s8.length() > 0)
                s8 = s8 + "&nbsp; | &nbsp;";
            s8 = s8 + templates.liga(as[2], s11);
        }

        s6 = utilerias.replaceString(s6, "<!--menu-->", s8);
        if(i == 92)
        {
            String s10 = generaArbolOpcion(httpservletrequest.getParameter("dic_menu"), httpservletrequest.getParameter("dic_submenu"), s2, s3, httpservletrequest, s9);
            s6 = utilerias.replaceString(s6, "<!--submenu-->", s10);
        }
        return s6;
    }

    private String generaJavaScriptMenus(String s, String s1, HttpSession httpsession, HttpServletRequest httpservletrequest)
        throws IOException
    {
        String s2 = "";
        String s3 = utilerias.tomaProp("url_clases", props);
        if(httpsession.getAttribute("dic_menu") == null)
        {
            String s4 = templates.generaMenus(s, s1, httpservletrequest, s3 + "/scm/servlet/ConectAc");
            httpsession.setAttribute("dic_menu", s4);
        }
        s2 = httpsession.getAttribute("dic_menu").toString();
        return s2;
    }

    private String generaOpcionesArbol(String s, String s1, String s2, Vector vector, String s3, String s4, HttpServletRequest httpservletrequest)
    {
        String s5 = utilerias.tomaProp("dir_pagInicio", props);
        String s6 = templates.generaImagen("boton", s5 + "/media/boton.jpg", "");
        String s7 = "";
        int i = 0;
        int j = 0;
        String s8 = "black";
        String s9 = "Arial";
        String s10 = "2";
        String s11 = "#FFFFFF";
        String s12 = "#FFFFFF";
        String s13 = s11;
        for(; i < vector.size(); i++)
        {
            dbRecord dbrecord = (dbRecord)vector.elementAt(i);
            String s14 = dbrecord.getField(1);
            String s15 = dbrecord.getField(2);
            String s16 = dbrecord.getField(3);
            String s17 = dbrecord.getField(4);
            String s18 = dbrecord.getField(5);
            String s19 = dbrecord.getField(6);
            s14 = s14.trim();
            s15 = s15.trim();
            if(s16 == null)
                s16 = "";
            s16 = s16.trim();
            s16 = s4 + "?dic_estado=8&dic_tabla=" + s16 + "&dic_sistema=" + s3 + "&dic_menu=" + s2 + "&dic_submenu=" + s14;
            if(s17 == null)
                s17 = "";
            if(s17.trim().length() > 0)
            {
                s16 = utilerias.replaceString(s17, "programa_aparte=", "");
                s16 = s4 + "?dic_estado=1027&dic_sistema=" + s3 + "&dic_menu=" + s2 + "&dic_submenu=" + s14 + "&liga=" + s16;
            }
            if(s19.equals(s2))
            {
                if(httpservletrequest.getParameter("dic_submenu") != null)
                    if(httpservletrequest.getParameter("dic_submenu").toString().equals(s14))
                        s11 = s12;
                    else
                        s11 = s13;
                String s20 = s + j;
                String s21 = utilerias.replaceString(s20, "desc", "desturl");
                String s22 = "1";
                String s23 = templates.tablaCol("<b>" + s6 + "</b>&nbsp;", s8, s9, s10, s11);
                String s24 = "<span class=\"nosubr\">";
                String s25 = "</span>";
                if(s18.equals("M"))
                    s22 = "0";
                if(!s18.equals("M"))
                    s7 = s7 + "<tr>" + s23 + templates.tablaCol(templates.liga(s24 + s15 + s24, s16), s8, s9, s10, s11) + "</tr>";
                if(s18.equals("M"))
                {
                    s7 = s7 + "<tr>" + s23 + templates.tablaCol("\244" + s15, s8, s9, s10, s11) + "</tr>";
                    s7 = s7 + generaOpcionesArbol(s, s1, s14, vector, s3, s4, httpservletrequest);
                }
                j++;
            }
        }

        return s7;
    }

    private String generaSalidaSistema(HttpSession httpsession, HttpServletRequest httpservletrequest)
        throws IOException
    {
        String s = "";
        String s2 = utilerias.tomaProp("pag_salir", props);
        if(httpsession != null)
        {
            utilerias.insertaBitacora(httpservletrequest, "");
            httpsession.invalidate();
        }
        if(s2.length() == 0)
        {
            return "";
        } else
        {
            String s1 = templates.generaPlantilla(dir_pagInicio + s2, httpservletrequest);
            return s1;
        }
    }

    private String molde(HttpServletRequest httpservletrequest)
        throws IOException
    {
        String s = "";
        return s;
    }

    Properties props;
    String dir_pagInicio;
}